package com.mos.entity;

import com.mos.support.AccSupport;
import com.mos.util.DateUtils;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.Map;


/**
 * @description 菜单
 */
public class Menu  implements RowMapper, java.io.Serializable {

    private static final long serialVersionUID = -1619158127650389417L;

    private Map<String, AccSupport> accMap;// 附件封装

    private String id;

    private String name;//菜单名字

    private String pid;//父id

    private String traceIds;//轨迹ids 顺序存储父级id及本身id

    private String path;//路径

    private String icon;//图标

    private String permission;//权限标识

    private String isShow;//是否显示

    private Integer sortNo;//排序号

    private String description;//描述

    private Date createTime;//创建时间

    private String createrId;//创建人id

    private Date updateTime;//修改时间

    private String updaterId;//修改人id

    private String del;//删除状态

    public Map<String, AccSupport> getAccMap() {
        return accMap;
    }

    public void setAccMap(Map<String, AccSupport> accMap) {
        this.accMap = accMap;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getTraceIds() {
        return traceIds;
    }

    public void setTraceIds(String traceIds) {
        this.traceIds = traceIds;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public String getIsShow() {
        return isShow;
    }

    public void setIsShow(String isShow) {
        this.isShow = isShow;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreaterId() {
        return createrId;
    }

    public void setCreaterId(String createrId) {
        this.createrId = createrId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdaterId() {
        return updaterId;
    }

    public void setUpdaterId(String updaterId) {
        this.updaterId = updaterId;
    }

    public String getDel() {
        return del;
    }

    public void setDel(String del) {
        this.del = del;
    }

    public Menu mapRow(ResultSet rs, int rowNum) throws SQLException {
        Menu menu = new Menu();
        menu.setId(rs.getString(id));
        menu.setTraceIds(rs.getString(traceIds));
        menu.setDel(rs.getString(del));
        menu.setName(rs.getString(name));
        menu.setIcon(rs.getString(icon));
        menu.setCreaterId(rs.getString(createrId));
        menu.setUpdaterId(rs.getString(updaterId));
//        menu.setCreateTime(DateUtils.formatDate(rs.getString(createTime)));
        return menu;
    }
}
